namespace Rsdn.Framework.Formatting.JetBrains.Annotations
{
    using System;
    using System.Runtime.CompilerServices;

    /// <summary>
    /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library),
    /// so this symbol will not be marked as unused (as well as by other usage inspections)
    /// </summary>
    [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)]
    internal class UsedImplicitlyAttribute : Attribute
    {
        /// <summary>
        /// Initializes new instance of UsedImplicitlyAttribute
        /// </summary>
        public UsedImplicitlyAttribute()
            : this(ImplicitUseFlags.Default)
        {
        }

        /// <summary>
        /// Initializes new instance of UsedImplicitlyAttribute with specified flags
        /// </summary>
        /// <param name="flags">Value of type <see cref="T:Rsdn.Framework.Formatting.JetBrains.Annotations.ImplicitUseFlags" /> indicating usage kind</param>
        public UsedImplicitlyAttribute(ImplicitUseFlags flags)
        {
            this.Flags = flags;
        }

        /// <summary>
        /// Gets value indicating what is meant to be used
        /// </summary>
        [UsedImplicitly]
        public ImplicitUseFlags Flags
        {
            get;
            private set;
        }
    }
}

